package fun.wlfj.vo;

public class VoteTask {
	
	private String name;
	private int voteID = -1;
	private int s1, s2, s3;//定义了三种投票状态
	private boolean isFinished = false;
	
	
	
	public VoteTask() {
		this.s1 = this.s2 = this.s3 = 0;
	}



	public VoteTask(String name, int voteID, boolean isFinished) {
		super();
		this.name = name;
		this.voteID = voteID;
		this.isFinished = isFinished;
	}



	public String getName() {
		return name;
	}



	public void setName(String name) {
		this.name = name;
	}



	public int getS1() {
		return s1;
	}



	public void setS1(int s1) {
		this.s1 = s1;
	}



	public int getS2() {
		return s2;
	}



	public void setS2(int s2) {
		this.s2 = s2;
	}



	public int getS3() {
		return s3;
	}



	public void setS3(int s3) {
		this.s3 = s3;
	}



	public boolean isFinished() {
		return isFinished;
	}



	public void setFinished(boolean isFinished) {
		this.isFinished = isFinished;
	}



	public void add(int Choose) {
		//是否会有线程安全的问题呢?我们要使用一种安全的数据结构 这个方法需要小心了
		switch(Choose) {
		case 1:
			this.s1 ++;
			break;
		case 2:
			this.s2 ++;
			break;
		case 3:
			this.s3 ++;
			break;
		}
	}



	public int getVoteID() {
		return voteID;
	}



	public void setVoteID(int voteID) {
		this.voteID = voteID;
	}



	@Override
	public String toString() {
		return "VoteTask [name=" + name + ", voteID=" + voteID + ", s1=" + s1 + ", s2=" + s2 + ", s3=" + s3
				+ ", isFinished=" + isFinished + ", getName()=" + getName() + ", getS1()=" + getS1() + ", getS2()="
				+ getS2() + ", getS3()=" + getS3() + ", isFinished()=" + isFinished() + ", getVoteID()=" + getVoteID()
				+ ", getClass()=" + getClass() + ", hashCode()=" + hashCode() + ", toString()=" + super.toString()
				+ "]";
	}
	
	

}
